package org.ims.inv.model.flow;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Model: 工作流流程
 * 
 * @author Jeccy.Zhao
 *
 */
public class ModelFlowDef
extends ModelFlowBase
{

	/**
	 * Serial UID
	 */
	private static final long serialVersionUID = 5612601569032108056L;
	
	/**
	 * 流程被采用
	 */
	public static final Integer DEF_APPLIED = 1;
	
	/**
	 * 流程被废弃
	 */
	public static final Integer DEF_DROPPED = 0;
	
	/**
	 * 工作流名称
	 */
	private String defName;
	
	/**
	 * 工作流描述
	 */
	private String defDescription;
	
	/**
	 * 工作流创建时间
	 */
	private Date defCreationTime;
	
	/**
	 * 工作流流程
	 */
	private Set<ModelFlowTemplate> templates;
	
	/**
	 * 标志: 工作流是否被采用
	 */
	private Integer defApplied = DEF_DROPPED;
	
	/**
	 * Appends template data
	 * 
	 * @param template
	 */
	public void appendTemplateDate (ModelFlowTemplate template)
	{
		if (template != null)
		{
			if (this.templates == null)
			{
				this.templates = new HashSet<ModelFlowTemplate>();
			}
			
			this.templates.add(template);
		}
	}
	
	public String getDefName()
	{
		return defName;
	}

	public void setDefName(String defName)
	{
		this.defName = defName;
	}

	public Integer getDefApplied()
	{
		return defApplied;
	}

	public void setDefApplied(Integer defApplied)
	{
		this.defApplied = defApplied;
	}

	public void setDefDescription(String defDescription)
	{
		this.defDescription = defDescription;
	}

	public String getDefDescription()
	{
		return defDescription;
	}

	public void setDefCreationTime(Date defCreationTime)
	{
		this.defCreationTime = defCreationTime;
	}

	public Date getDefCreationTime()
	{
		return defCreationTime;
	}

	public void setTemplates(Set<ModelFlowTemplate> templates)
	{
		this.templates = templates;
	}

	public Set<ModelFlowTemplate> getTemplates()
	{
		return templates;
	}
	
}
